﻿using System.ComponentModel;

namespace SqlProcessViewer
{
	public static class ListSortDirectionExtensions
	{
		private const string ASCENDING = "HeaderTemplateArrowUp";
		private const string DESCENDING = "HeaderTemplateArrowDown";
		private const ListSortDirection DEFAULT = ListSortDirection.Ascending;

		public static string ToResourceName(this ListSortDirection @this)
		{
			switch (@this)
			{
				case ListSortDirection.Ascending:
					return ASCENDING;
				default:
					return DESCENDING;
			}
		}

		public static ListSortDirection Toggle(this ListSortDirection @this)
		{
			switch (@this)
			{
				case ListSortDirection.Ascending:
					return ListSortDirection.Descending;
				default:
					return ListSortDirection.Ascending;
			}
		}
	}
}